import request from "../util/require"


/**
 * @description: 获取路径下的文件
 * @param {*} router
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function getDir(routerId: number = 1){
    return request.get("/api/file/getDirFile", {
        params: {
            routerId
        }
    })
}


/**
 * @description: 模糊搜索
 * @param {string} searchText
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function searchByName( searchText: string ){
    return request.get("/api/file/searchDir", {
        params: {
            serName: searchText
        }
    })
}



/**
 * @description: 获取视频信息
 * @param {number} id
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function getVideo( id: number ){
    return request.get(`api/video/getVideo/${id}`)
}



export function getStream(){
    return request.get('/api/video/getVideoStream', {
        headers: { responseType: 'arraybuffer' }
    })
}

